package com.queen.restaurant.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.queen.restaurant.domain.Course;
import com.queen.restaurant.domain.CourseType;

@Repository
public class CourseDao extends BaseDao<Course>{
	//根据菜品类别id查找该菜品类别下的所有菜品
	public List<Course> getCourseByCourseTypeId(int id){
		String hql = "from Course course where course.courseType.id=?";
		return getHibernateTemplate().find(hql,id);
	}
	
	//根据菜品id删除菜品
	public void deleteCourseById(int id){
		String hql = "delete from Course course where course.id=?";
		getHibernateTemplate().bulkUpdate(hql, id);
	}
}
